

function ydlConfrim(title,yesFunction,noFunction){
    layer.confirm(title, {
        icon: 3,
        btn: ['确定','取消'] //按钮
        ,offset: 'auto',
    }, function(index){
        if(yesFunction!=undefined) {
            yesFunction();
        }
        layer.close(index);
    }, function(){
        if(noFunction!=undefined){
            noFunction();
        }
    });
}


function ydlOpenDialog(id ,title,url,width,height){
	  var index=parent.layer.open({
	        id:id,
	        type: 2,
	        title: title,
	        area: [width, height],
	        shade: 0.8,
	        fix:true,
	        zIndex: layer.zIndex,
	        shadeClose: true,
	        content:[url,'yes'],
	        resize:true,
	        maxmin:true,
	        fixed:true,
	        shade:   [0.1, '#393D49'],
	        shadeClose:false,
	        success: function(layero, index){

	       }
	  });
	   
	}

	function ydlCloseDialog(){
	    var index = layer.getFrameIndex(window.name);
	    layer.close(index);
	}


function ydlAlter(title,yesFunction){
    layer.alert(title, {
       closeBtn: 0,
        icon:8,
    }, function (index) {
        if(yesFunction!=undefined) {
            yesFunction();
        }
        layer.close(index);
    });
}


function  ydlLoad(){
    var index = layer.load(2, {shade: false}); //0代表加载的风格，支持0-2
    setTimeout(function(){
        layer.close(index);
    },800);
}


function ydlTips(title,elements){
    layer.tips(title, elements, {
        tips: [3, '#18ce96'],
        time: 2000
    });
}

function ydlMsg(title){
    layer.msg(title,{ time: 2000});
}
function ydlMsgIcon(title,icon){
    if(icon==undefined){
        icon=5;
    }
    layer.msg(title, {icon: icon});
}
function ydlDiyDialog(elements,cancelFunction){
    //捕获页
    layer.open({
        type: 1,
        shade: false,
        title: false, //不显示标题
        content: elements, //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
        cancel: function(){
            if(cancelFunction!=undefined){
                cancelFunction();
            }
        }
    });
}

function ydlPrompt(title,callFunction){
    layer.prompt({title: title, formType: 1}, function(pass, index){
        if(callFunction!=undefined){
            callFunction();
        }
        layer.close(index);
    });
}

function ydlDiyHtml(width,height,centent){
    layer.open({
        type: 1,
        skin: 'layui-layer-rim', //加上边框
        area: [width, height], //宽高
        content: centent
    });
}



